/*
 * serial_displayer.h
 *
 *  Created on: 2020年5月14日
 *      Author: Administrator
 */

#ifndef SERIAL_DISPLAYER_H_
#define SERIAL_DISPLAYER_H_

#include <rtthread.h>

rt_err_t sdisp_init(void);
rt_err_t sdisp_show(rt_uint16_t *rgb_buf, rt_uint32_t width, rt_uint32_t height);
rt_err_t sdisp_print(const char *text, int line_num);

#define RGB888TO565(r, g, b)( ((b >> 3) << 11) | ((r >> 2) << 5) | (g >> 3))

#define RGB_RED             RGB888TO565(255, 0, 0)
#define RGB_GREEN           RGB888TO565(0, 255, 0)
#define RGB_BLUE            RGB888TO565(0, 0, 255)
#define RGB_YELLOW          RGB888TO565(255, 255, 0)
#define RGB_ORANGE          RGB888TO565(255, 128, 0)
#define RGB_PURPLE          RGB888TO565(255, 0, 255)
#define RGB_GREEN_LIGHT     RGB888TO565(0, 255, 255)
#define RGB_BROWN           RGB888TO565(128, 64, 64)

#endif /* SERIAL_DISPLAYER_H_ */
